package com.gitee.zycra.file.param;

import java.util.List;

/**
 * The param class for download.
 *
 * @author zycra
 * @since 1.0.0
 */
public final class DownloadParam {

    /**
     * Server path where the file is located.
     *
     * @since 1.0.0
     */
    private String serverPath;

    /**
     * Local path where the file is located.
     *
     * @since 1.0.0
     */
    private String localPath;

    /**
     * File name regular expression.
     * <p>Match file name under the {@link #serverPath}, and put the matched file name into the {@link #fileNameList}.
     *
     * @since 1.0.0
     */
    private String filePattern;

    /**
     * File name list to download.
     *
     * @since 1.0.0
     */
    private List<String> fileNameList;

    /**
     * Whether to decrypt the downloaded file.
     *
     * @since 1.0.0
     */
    private boolean decrypt;

    /**
     * The key to decrypt the file.
     * <p>Key type is SM2 private key from inner.
     *
     * @since 1.0.0
     */
    private String decryptKey;

    /**
     * The key to check sign of the file.
     * <p>Key type is SM2 public key from outer.
     *
     * @since 1.0.0
     */
    private String checkSignKey;

    /**
     * The speed limit for transfer(kb/s).
     * <p>0 or negative means no limit.
     *
     * @since 1.0.0
     */
    private long speedLimit;

    public String getServerPath() {
        return serverPath;
    }

    public DownloadParam setServerPath(String serverPath) {
        this.serverPath = serverPath;
        return this;
    }

    public String getLocalPath() {
        return localPath;
    }

    public DownloadParam setLocalPath(String localPath) {
        this.localPath = localPath;
        return this;
    }

    public String getFilePattern() {
        return filePattern;
    }

    public DownloadParam setFilePattern(String filePattern) {
        this.filePattern = filePattern;
        return this;
    }

    public List<String> getFileNameList() {
        return fileNameList;
    }

    public DownloadParam setFileNameList(List<String> fileNameList) {
        this.fileNameList = fileNameList;
        return this;
    }

    public boolean isDecrypt() {
        return decrypt;
    }

    public DownloadParam setDecrypt(boolean decrypt) {
        this.decrypt = decrypt;
        return this;
    }

    public String getDecryptKey() {
        return decryptKey;
    }

    public DownloadParam setDecryptKey(String decryptKey) {
        this.decryptKey = decryptKey;
        return this;
    }

    public String getCheckSignKey() {
        return checkSignKey;
    }

    public DownloadParam setCheckSignKey(String checkSignKey) {
        this.checkSignKey = checkSignKey;
        return this;
    }

    public long getSpeedLimit() {
        return speedLimit;
    }

    public DownloadParam setSpeedLimit(long speedLimit) {
        this.speedLimit = speedLimit;
        return this;
    }
}
